<template>
	<header class="header">
		<Icon :class="hidemenu?'rotate':''" class="menu-icon" size="25" type="md-reorder" @click="toggle" />
		<div>
			<!-- <Badge :count="3">
				<Icon size="25" type="ios-notifications-outline" />
			</Badge>
			<Avatar class="avatar" icon="ios-person" /> -->
            <div class="nick">
                <p><span class="organName">{{ user.organ ? user.organ.organName : ''}}</span></p>
                <p><span>{{ user.organ ? user.organ.organCode : ''}}</span></p>
            </div>
		</div>
	</header>
</template>
<script>
import { mapState, mapMutations } from '@lib/x_.js'
export default {
	computed: {
		...mapState(['hidemenu','user']),
		...mapMutations(['toggleMenu'])
	},
	methods: {
		toggle() {
			this.$store.commit('toggleMenu')
		}
	}
}
</script>
<style lang="scss">
.header {
	height: 60px;
	border-bottom: 1px solid #dcdee2;
	background-color: #fff;
	box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
	width: 100%;
	top: 0;
	left: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-left: 10px;
    padding-right: 30px;
    .avatar{
        margin-left: 20px;
    }
    .nick{
        margin-left: 10px;
        line-height: 20px;
        text-align: left;
    }
    .ivu-badge-count{
        top: 0;
    }
    .menu-icon{
        transition: all 0.2s ease;
    }
    .rotate{
        transform: rotate(-90deg);
    }
    .organName{
        font-weight: 600;
    }
}
</style>